/**
 * <b>项目名：</b>oasis-cms<br/>
 * <b>包名：</b>com.bookdao.oasis.config<br/>
 * <b>文件名：</b>HttpMessageConvertConfig.java<br/>
 * <b>描述：</b><br/>
 * <b>版本信息：</b>v1.0.0<br/>
 * <b>日期：</b>2017年1月10日-下午6:41:33<br/>
 * <b>Copyright (c)</b> 2017智道@版权所有<br/>
 */

package com.bookdao.oasis.config;

import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.web.HttpMessageConverters;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;

import com.bookdao.oasis.common.tools.json.jackson.CustomObjectMapper;

/**
 * <b>类名称：</b>HttpMessageConvertConfig <br/>
 * <b>类描述：</b>转换器<br/>
 * <b>创建人：</b>zhanghj<br/>
 * <b>修改人：</b><br/>
 * <b>修改时间：</b>2017年1月10日 下午6:41:33<br/>
 * <b>修改备注：</b><br/>
 * <b>版本信息：</b>v1.0.0<br/>
 */
@Configuration
public class HttpMessageConvertConfig {
	
	@Bean
	public CustomObjectMapper getObjectMapper(){
		return new CustomObjectMapper();
	}

	
	/*@Bean
	@ConditionalOnMissingBean
	public HttpMessageConverters customConverters(){
		System.out.println("HttpMessageConverters.................");
		MappingJackson2HttpMessageConverter jsonConvert=new MappingJackson2HttpMessageConverter(getObjectMapper());
		return new HttpMessageConverters(jsonConvert);
	}*/
	@Bean
	public MappingJackson2HttpMessageConverter customJsonConverter(){
		MappingJackson2HttpMessageConverter conver=new MappingJackson2HttpMessageConverter(getObjectMapper());
		return conver;
	}
}
